import React from "react";
import {Sin, Son} from './Son';

export default class Father extends React.Component{
    // state={
    //     name:'小李',
    //     age:100,
    //     manemy:100
    // }
    state={
        name: "效力"
    }
   
    render(){
        return(
            <div>
                 <h1>我是父组件</h1>
                 <span>{this.state.name}</span>
                 
                 <Son getMsg={this.getChildMsg} />
            </div>
        )
    }
    getStat =()=>{
        console.log(this);
        this.setState({
            name: this.state.name
        })
        
    }
    getChildMsg=(msg)=>{
        console.log('接收到子组件数据', msg)

    }
}